package com.yuliang.ai.controller;

import com.yuliang.ai.domain.Dto.TourCommonDto;
import com.yuliang.ai.domain.Vo.TripRouteVo;
import com.yuliang.ai.service.TripRouteService;
import com.yuliang.utils.result.ResultUtils;
import com.yuliang.utils.result.emums.HttpCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Huangkai
 */
@Slf4j
@RestController
@RequestMapping("/tripRoute")
public class TripRouteController {

    @Autowired
    TripRouteService tripRouteService;

    @PostMapping(value = "/getTripRouteInfosByFilter")
    public String getTripRouteInfosByFilter(@RequestBody  TripRouteVo tripRouteVo) {
        TourCommonDto tourCommonDto = tripRouteService.getTripRouteInfosByFilter(tripRouteVo);
        if(tourCommonDto != null){
            return ResultUtils.ResultWithMessageDataEnum(HttpCodeEnum.select_success, tourCommonDto);
        }
        return ResultUtils.ResultWithMessageEnum(HttpCodeEnum.data_not_exist);
    }

}
